package com.shy.service;

import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;

@Service
public class HelloService {

    @Autowired
    private RedisTemplate redisTemplate;

    static public Logger logger = org.slf4j.LoggerFactory.getLogger(HelloService.class);

    public void hello() {
        ValueOperations ops = redisTemplate.opsForValue();
        ops.set("hello", "world");
        logger.info((String) ops.get("hello"));

    }
}
